package com.sinsoft.monitorDemo.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.sinsoft.monitorDemo.dao.TomcatNameDao;
import com.sinsoft.monitorDemo.entity.TomcatName;

@Controller
@RequestMapping("/tomcatName")
public class TomcatNameController {
	@RequestMapping("/getTomcatName")
	public String getTomcatName(HttpServletRequest request){
		TomcatNameDao dao = new TomcatNameDao();
		String ip = request.getParameter("ip");
		List<String> tomcatName = dao.getTomcatName(ip);
		TomcatName tomcatNames = new TomcatName(ip, tomcatName);
		request.setAttribute("tomcatNames", tomcatNames);
		return "applicationMonitor";
		
	}

}
